﻿namespace Sys.API.Models
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Nancy.Security;
    using Nancy.Demo.Authentication.Token;
    using LY.Interface;
    using LY.Business.ServiceImpl;

    public class UserDatabase
    {
        //private static readonly List<Tuple<string, string>> Users = new List<Tuple<string, string>>();
        private static readonly Dictionary<string, List<string>> Claims = new Dictionary<string, List<string>>();
        
        //static UserDatabase()
        //{
        //    Users.Add(new Tuple<string, string>("demo", "demo"));
        //    Claims.Add("demo", new List<string> { "demo", "admin" });

        //    Users.Add(new Tuple<string, string>("nonadmin", "nonadmin"));
        //    Claims.Add("nonadmin", new List<string> { "demo", });
        //}

        public static IUserIdentity ValidateApp(string appid, string secret)
        {

            //IOAuthService ouath = new OAuthService();
            //var orginfo= ouath.GetAppInfo(appid, secret);
            //if (orginfo == null) { return null; }
            ////Claims.Add(orginfo.AppId,new List<string> { orginfo.AppId, });
            ////var claims = Claims[orginfo.AppId];  
            ////Claims = claims, 
            //return new UserIdentity { UserName = orginfo.AppId,Claims=new List<string> { orginfo.AppId, },Status = orginfo.Status, RefreshToken=orginfo.Refresh_token };
            return null;
        }
    }
}